<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Module: Sass::Script::Functions</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html">Index (F)</a> &raquo; 
    <span class='title'><a href="Sass-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass.html" title="Sass (module)">Sass</a></span> &raquo; <span class='title'><a href="Script.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script.html" title="Sass::Script (module)">Script</a></span>
     &raquo; 
    <span class="title">Functions</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="javascript:if(confirm(%27http://sass-lang.com/docs/yardoc/Sass/Script/.  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?%27))window.location=%27http://sass-lang.com/docs/yardoc/Sass/Script/.%27" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Module: Sass::Script::Functions 
  
  
</h1>

<dl class="box">
  
  
    
  
    
  
  
    <dt class="r1 last">Defined in:</dt>
    <dd class="r1 last">/var/www/sass-pages/.sass/lib/sass/script/functions.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>Methods in this module are accessible from the SassScript context. For example, you can write</p>

<pre class="code">$color = hsl(120deg, 100%, 50%)</pre>

<p>and it will call <tt><a href="#hsl-instance_method" title="Sass::Script::Functions#hsl (method)">Sass::Script::Functions#hsl</a></tt>.</p>

<p>The following functions are provided:</p>

<p><em>Note: These functions are described in more detail below.</em></p>

<h2 id='rgb_functions'>RGB Functions</h2>

<dl>
<dt><tt><a href="#rgb-instance_method" title="Sass::Script::Functions#rgb (method)">rgb($red, $green, $blue)</a></tt></dt>

<dd>Converts an <code>rgb(red, green, blue)</code> triplet into a color.</dd>

<dt><tt><a href="#rgba-instance_method" title="Sass::Script::Functions#rgba (method)">rgba($red, $green, $blue, $alpha)</a></tt></dt>

<dd>Converts an <code>rgba(red, green, blue, alpha)</code> quadruplet into a color.</dd>

<dt><tt><a href="#rgba-instance_method" title="Sass::Script::Functions#rgba (method)">rgba($color, $alpha)</a></tt></dt>

<dd>Adds an alpha layer to any color value.</dd>

<dt><tt><a href="#red-instance_method" title="Sass::Script::Functions#red (method)">red($color)</a></tt></dt>

<dd>Gets the red component of a color.</dd>

<dt><tt><a href="#green-instance_method" title="Sass::Script::Functions#green (method)">green($color)</a></tt></dt>

<dd>Gets the green component of a color.</dd>

<dt><tt><a href="#blue-instance_method" title="Sass::Script::Functions#blue (method)">blue($color)</a></tt></dt>

<dd>Gets the blue component of a color.</dd>

<dt><tt><a href="#mix-instance_method" title="Sass::Script::Functions#mix (method)">mix($color-1, $color-2, [$weight])</a></tt></dt>

<dd>Mixes two colors together.</dd>
</dl>

<h2 id='hsl_functions'>HSL Functions</h2>

<dl>
<dt><tt><a href="#hsl-instance_method" title="Sass::Script::Functions#hsl (method)">hsl($hue, $saturation, $lightness)</a></tt></dt>

<dd>Converts an <code>hsl(hue, saturation, lightness)</code> triplet into a color.</dd>

<dt><tt><a href="#hsla-instance_method" title="Sass::Script::Functions#hsla (method)">hsla($hue, $saturation, $lightness, $alpha)</a></tt></dt>

<dd>Converts an <code>hsla(hue, saturation, lightness, alpha)</code> quadruplet into a color.</dd>

<dt><tt><a href="#hue-instance_method" title="Sass::Script::Functions#hue (method)">hue($color)</a></tt></dt>

<dd>Gets the hue component of a color.</dd>

<dt><tt><a href="#saturation-instance_method" title="Sass::Script::Functions#saturation (method)">saturation($color)</a></tt></dt>

<dd>Gets the saturation component of a color.</dd>

<dt><tt><a href="#lightness-instance_method" title="Sass::Script::Functions#lightness (method)">lightness($color)</a></tt></dt>

<dd>Gets the lightness component of a color.</dd>

<dt><tt><a href="#adjust_hue-instance_method" title="Sass::Script::Functions#adjust_hue (method)">adjust-hue($color, $degrees)</a></tt></dt>

<dd>Changes the hue of a color.</dd>

<dt><tt><a href="#lighten-instance_method" title="Sass::Script::Functions#lighten (method)">lighten($color, $amount)</a></tt></dt>

<dd>Makes a color lighter.</dd>

<dt><tt><a href="#darken-instance_method" title="Sass::Script::Functions#darken (method)">darken($color, $amount)</a></tt></dt>

<dd>Makes a color darker.</dd>

<dt><tt><a href="#saturate-instance_method" title="Sass::Script::Functions#saturate (method)">saturate($color, $amount)</a></tt></dt>

<dd>Makes a color more saturated.</dd>

<dt><tt><a href="#desaturate-instance_method" title="Sass::Script::Functions#desaturate (method)">desaturate($color, $amount)</a></tt></dt>

<dd>Makes a color less saturated.</dd>

<dt><tt><a href="#grayscale-instance_method" title="Sass::Script::Functions#grayscale (method)">grayscale($color)</a></tt></dt>

<dd>Converts a color to grayscale.</dd>

<dt><tt><a href="#complement-instance_method" title="Sass::Script::Functions#complement (method)">complement($color)</a></tt></dt>

<dd>Returns the complement of a color.</dd>

<dt><tt><a href="#invert-instance_method" title="Sass::Script::Functions#invert (method)">invert($color)</a></tt></dt>

<dd>Returns the inverse of a color.</dd>
</dl>

<h2 id='opacity_functions'>Opacity Functions</h2>

<dl>
<dt><tt><a href="#alpha-instance_method" title="Sass::Script::Functions#alpha (method)">alpha($color)</a></tt> / <tt><a href="#opacity-instance_method" title="Sass::Script::Functions#opacity (method)">opacity($color)</a></tt></dt>

<dd>Gets the alpha component (opacity) of a color.</dd>

<dt><tt><a href="#rgba-instance_method" title="Sass::Script::Functions#rgba (method)">rgba($color, $alpha)</a></tt></dt>

<dd>Add or change an alpha layer for any color value.</dd>

<dt><tt><a href="#opacify-instance_method" title="Sass::Script::Functions#opacify (method)">opacify($color, $amount)</a></tt> / <tt><a href="#fade_in-instance_method" title="Sass::Script::Functions#fade_in (method)">fade-in($color, $amount)</a></tt></dt>

<dd>Makes a color more opaque.</dd>

<dt><tt><a href="#transparentize-instance_method" title="Sass::Script::Functions#transparentize (method)">transparentize($color, $amount)</a></tt> / <tt><a href="#fade_out-instance_method" title="Sass::Script::Functions#fade_out (method)">fade-out($color, $amount)</a></tt></dt>

<dd>Makes a color more transparent.</dd>
</dl>

<h2 id='other_color_functions'>Other Color Functions</h2>

<dl>
<dt><tt><a href="#adjust_color-instance_method" title="Sass::Script::Functions#adjust_color (method)">adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])</a></tt></dt>

<dd>Increase or decrease any of the components of a color.</dd>

<dt><tt><a href="#scale_color-instance_method" title="Sass::Script::Functions#scale_color (method)">scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])</a></tt></dt>

<dd>Fluidly scale one or more components of a color.</dd>

<dt><tt><a href="#change_color-instance_method" title="Sass::Script::Functions#change_color (method)">change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])</a></tt></dt>

<dd>Changes one or more properties of a color.</dd>

<dt><tt><a href="#ie_hex_str-instance_method" title="Sass::Script::Functions#ie_hex_str (method)">ie-hex-str($color)</a></tt></dt>

<dd>Converts a color into the format understood by IE filters.</dd>
</dl>

<h2 id='string_functions'>String Functions</h2>

<dl>
<dt><tt><a href="#unquote-instance_method" title="Sass::Script::Functions#unquote (method)">unquote($string)</a></tt></dt>

<dd>Removes the quotes from a string.</dd>

<dt><tt><a href="#quote-instance_method" title="Sass::Script::Functions#quote (method)">quote($string)</a></tt></dt>

<dd>Adds quotes to a string.</dd>
</dl>

<h2 id='number_functions'>Number Functions</h2>

<dl>
<dt><tt><a href="#percentage-instance_method" title="Sass::Script::Functions#percentage (method)">percentage($value)</a></tt></dt>

<dd>Converts a unitless number to a percentage.</dd>

<dt><tt><a href="#round-instance_method" title="Sass::Script::Functions#round (method)">round($value)</a></tt></dt>

<dd>Rounds a number to the nearest whole number.</dd>

<dt><tt><a href="#ceil-instance_method" title="Sass::Script::Functions#ceil (method)">ceil($value)</a></tt></dt>

<dd>Rounds a number up to the nearest whole number.</dd>

<dt><tt><a href="#floor-instance_method" title="Sass::Script::Functions#floor (method)">floor($value)</a></tt></dt>

<dd>Rounds a number down to the nearest whole number.</dd>

<dt><tt><a href="#abs-instance_method" title="Sass::Script::Functions#abs (method)">abs($value)</a></tt></dt>

<dd>Returns the absolute value of a number.</dd>

<dt><tt><a href="#min-instance_method" title="Sass::Script::Functions#min (method)">min($x1, $x2, &#8230;)</a></tt></dt>

<dd>Finds the minimum of several values.</dd>

<dt><tt><a href="#max-instance_method" title="Sass::Script::Functions#max (method)">max($x1, $x2, &#8230;)</a></tt></dt>

<dd>Finds the maximum of several values.</dd>
</dl>

<h2 id='list-functions'>List Functions</h2>

<dl>
<dt><tt><a href="#length-instance_method" title="Sass::Script::Functions#length (method)">length($list)</a></tt></dt>

<dd>Returns the length of a list.</dd>

<dt><tt><a href="#nth-instance_method" title="Sass::Script::Functions#nth (method)">nth($list, $n)</a></tt></dt>

<dd>Returns a specific item in a list.</dd>

<dt><tt><a href="#join-instance_method" title="Sass::Script::Functions#join (method)">join($list1, $list2, [$separator])</a></tt></dt>

<dd>Joins together two lists into one.</dd>

<dt><tt><a href="#append-instance_method" title="Sass::Script::Functions#append (method)">append($list1, $val, [$separator])</a></tt></dt>

<dd>Appends a single value onto the end of a list.</dd>
</dl>

<h2 id='introspection_functions'>Introspection Functions</h2>

<dl>
<dt><tt><a href="#type_of-instance_method" title="Sass::Script::Functions#type_of (method)">type-of($value)</a></tt></dt>

<dd>Returns the type of a value.</dd>

<dt><tt><a href="#unit-instance_method" title="Sass::Script::Functions#unit (method)">unit($number)</a></tt></dt>

<dd>Returns the units associated with a number.</dd>

<dt><tt><a href="#unitless-instance_method" title="Sass::Script::Functions#unitless (method)">unitless($number)</a></tt></dt>

<dd>Returns whether a number has units or not.</dd>

<dt><tt><a href="#comparable-instance_method" title="Sass::Script::Functions#comparable (method)">comparable($number-1, $number-2)</a></tt></dt>

<dd>Returns whether two numbers can be added or compared.</dd>
</dl>

<h2 id='miscellaneous_functions'>Miscellaneous Functions</h2>

<dl>
<dt><tt><a href="#if-instance_method" title="Sass::Script::Functions#if (method)">if($condition, $if-true, $if-false)</a></tt></dt>

<dd>Returns one of two values, depending on whether or not a condition is true.</dd>
</dl>

<h2 id='adding_custom_functions'>Adding Custom Functions</h2>

<p>New Sass functions can be added by adding Ruby methods to this module. For example:</p>

<pre class="code">module Sass::Script::Functions
  def reverse(string)
    assert_type string, :String
    Sass::Script::String.new(string.value.reverse)
  end
  declare :reverse, :args =&gt; [:string]
end</pre>

<p>Calling <tt><a href="#declare-class_method" title="Sass::Script::Functions.declare (method)">declare</a></tt> tells Sass the argument names for your function. If omitted, the function will still work, but will not be able to accept keyword arguments. <tt><a href="#declare-class_method" title="Sass::Script::Functions.declare (method)">declare</a></tt> can also allow your function to take arbitrary keyword arguments.</p>

<p>There are a few things to keep in mind when modifying this module. First of all, the arguments passed are <tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Sass::Script::Literal</a></tt> objects. Literal objects are also expected to be returned. This means that Ruby values must be unwrapped and wrapped.</p>

<p>Most Literal objects support the <tt><a href="Literal.html#value-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#value-instance_method" title="Sass::Script::Literal#value (method)">value</a></tt> accessor for getting their Ruby values. Color objects, though, must be accessed using <tt><a href="Color.html#rgb-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html#rgb-instance_method" title="Sass::Script::Color#rgb (method)">rgb</a></tt>, <tt><a href="Color.html#red-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html#red-instance_method" title="Sass::Script::Color#red (method)">red</a></tt>, <tt><a href="Color.html#blue-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html#blue-instance_method" title="Sass::Script::Color#blue (method)">green</a></tt>, or <tt><a href="Color.html#blue-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html#blue-instance_method" title="Sass::Script::Color#blue (method)">blue</a></tt>.</p>

<p>Second, making Ruby functions accessible from Sass introduces the temptation to do things like database access within stylesheets. This is generally a bad idea; since Sass files are by default only compiled once, dynamic code is not a great fit.</p>

<p>If you really, really need to compile Sass on each request, first make sure you have adequate caching set up. Then you can use <tt><a href="Engine.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Engine.html" title="Sass::Engine (class)">Sass::Engine</a></tt> to render the code, using the <a href="file.SASS_REFERENCE.html#custom-option" tppabs="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#custom-option" title="&lt;code&gt;options&lt;/code&gt; parameter"><code>options</code> parameter</a> to pass in data that <tt><a href="EvaluationContext.html#options-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Functions/EvaluationContext.html#options-instance_method" title="Sass::Script::Functions::EvaluationContext#options (method)">can be accessed</a></tt> from your Sass functions.</p>

<p>Within one of the functions in this module, methods of <tt><a href="EvaluationContext.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Functions/EvaluationContext.html" title="Sass::Script::Functions::EvaluationContext (class)">EvaluationContext</a></tt> can be used.</p>

<h3 id='caveats'>Caveats</h3>

<p>When creating new <tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt> objects within functions, be aware that it&#8217;s not safe to call <tt><a href="Literal.html#to_s-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html#to_s-instance_method" title="Sass::Script::Literal#to_s (method)">#to_s</a></tt> (or other methods that use the string representation) on those objects without first setting <tt><a href="Node-1.html#options%3D-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Node.html#options%3D-instance_method" title="Sass::Script::Node#options= (method)">the #options attribute</a></tt>.</p>

  </div>
</div>
<div class="tags">
  
</div><h2>Defined Under Namespace</h2>
<p class="children">
   
    
   
    
      <strong class="classes">Classes:</strong> <a href="EvaluationContext.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Functions/EvaluationContext.html" title="Sass::Script::Functions::EvaluationContext (class)">EvaluationContext</a>, <a href="Signature.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Functions/Signature.html" title="Sass::Script::Functions::Signature (class)">Signature</a>
    
  
</p>



  <h2>Class Method Summary</h2>

  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#declare-class_method" title="declare (class method)">+ <strong>declare</strong>(method_name, args, options = {}) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Declare a Sass signature for a Ruby-defined function.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#signature-class_method" title="signature (class method)">+ ({Symbol =&gt; Object}<sup>?</sup>) <strong>signature</strong>(method_name, arg_arity, kwarg_arity) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Determine the correct signature for the number of arguments passed in for a given function.</span>
  
</li>

    
  </ul>

  <h2>Instance Method Summary</h2>

  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#abs-instance_method" title="#abs (instance method)">- (Number) <strong>abs</strong>(value) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Finds the absolute value of a number.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#adjust_color-instance_method" title="#adjust_color (instance method)">- (Color) <strong>adjust_color</strong>(color, kwargs) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Adjusts one or more properties of a color.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#adjust_hue-instance_method" title="#adjust_hue (instance method)">- (Color) <strong>adjust_hue</strong>(color, degrees) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Changes the hue of a color while retaining the lightness and saturation.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#alpha-instance_method" title="#alpha (instance method)">- <strong>alpha</strong>(color) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the alpha component (opacity) of a color.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#append-instance_method" title="#append (instance method)">- <strong>append</strong>(list, val, separator:auto) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Appends a single value onto the end of a list.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#blue-instance_method" title="#blue (instance method)">- (Number) <strong>blue</strong>(color) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the blue component of a color.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#ceil-instance_method" title="#ceil (instance method)">- (Number) <strong>ceil</strong>(value) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Rounds a number up to the nearest whole number.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#change_color-instance_method" title="#change_color (instance method)">- (Color) <strong>change_color</strong>(color, kwargs) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Changes one or more properties of a color.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#comparable-instance_method" title="#comparable (instance method)">- (Bool) <strong>comparable</strong>(number_1, number_2) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns true if two numbers are similar enough to be added, subtracted, or compared.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#complement-instance_method" title="#complement (instance method)">- (Color) <strong>complement</strong>(color) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the complement of a color.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#darken-instance_method" title="#darken (instance method)">- (Color) <strong>darken</strong>(color, amount) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Makes a color darker.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#desaturate-instance_method" title="#desaturate (instance method)">- (Color) <strong>desaturate</strong>(color, amount) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Makes a color less saturated.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#floor-instance_method" title="#floor (instance method)">- (Number) <strong>floor</strong>(value) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Rounds down to the nearest whole number.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#grayscale-instance_method" title="#grayscale (instance method)">- (Color) <strong>grayscale</strong>(color) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Converts a color to grayscale.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#green-instance_method" title="#green (instance method)">- (Number) <strong>green</strong>(color) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the green component of a color.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#hsl-instance_method" title="#hsl (instance method)">- (Color) <strong>hsl</strong>(hue, saturation, lightness) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Creates a <tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt> object from hue, saturation, and lightness.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#hsla-instance_method" title="#hsla (instance method)">- (Color) <strong>hsla</strong>(hue, saturation, lightness, alpha) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Creates a <tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt> object from hue, saturation, and lightness, as well as an alpha channel indicating opacity.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#hue-instance_method" title="#hue (instance method)">- (Number) <strong>hue</strong>(color) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the hue component of a color.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#ie_hex_str-instance_method" title="#ie_hex_str (instance method)">- (String) <strong>ie_hex_str</strong>(color) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns an IE hex string for a color with an alpha channel suitable for passing to IE filters.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#if-instance_method" title="#if (instance method)">- <strong>if</strong>(condition, if_true, if_false) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns one of two values based on the truth value of the first argument.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#index-instance_method" title="#index (instance method)">- <strong>index</strong>(list, value) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the position of the given value within the given list.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#invert-instance_method" title="#invert (instance method)">- (Color) <strong>invert</strong>(color) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the inverse (negative) of a color.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#join-instance_method" title="#join (instance method)">- <strong>join</strong>(list1, list2, separator:auto) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Joins together two lists into a new list.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#length-instance_method" title="#length (instance method)">- (Number) <strong>length</strong>(list) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Return the length of a list.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#lighten-instance_method" title="#lighten (instance method)">- (Color) <strong>lighten</strong>(color, amount) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Makes a color lighter.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#lightness-instance_method" title="#lightness (instance method)">- (Number) <strong>lightness</strong>(color) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the hue component of a color.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#max-instance_method" title="#max (instance method)">- (Number) <strong>max</strong>(*values) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Finds the maximum of several values.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#min-instance_method" title="#min (instance method)">- (Number) <strong>min</strong>(*values) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Finds the minimum of several values.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#mix-instance_method" title="#mix (instance method)">- (Color) <strong>mix</strong>(color1, color2, weight:50%) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Mixes together two colors.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#nth-instance_method" title="#nth (instance method)">- (Literal) <strong>nth</strong>(list, n) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Gets the nth item in a list.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#opacify-instance_method" title="#opacify (instance method)">- (Color) <strong>opacify</strong>(color, amount) </a>
    

    
      (also: #fade_in)
    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Makes a color more opaque.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#opacity-instance_method" title="#opacity (instance method)">- (Number) <strong>opacity</strong>(color) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the alpha component (opacity) of a color.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#percentage-instance_method" title="#percentage (instance method)">- (Number) <strong>percentage</strong>(value) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Converts a decimal number to a percentage.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#quote-instance_method" title="#quote (instance method)">- (String) <strong>quote</strong>(string) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Add quotes to a string if the string isn&#8217;t quoted, or returns the same string if it is.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#red-instance_method" title="#red (instance method)">- (Number) <strong>red</strong>(color) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the red component of a color.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#rgb-instance_method" title="#rgb (instance method)">- (Color) <strong>rgb</strong>(red, green, blue) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Creates a <tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt> object from red, green, and blue values.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#rgba-instance_method" title="#rgba (instance method)">- <strong>rgba</strong>(*args) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#round-instance_method" title="#round (instance method)">- (Number) <strong>round</strong>(value) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Rounds a number to the nearest whole number.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#saturate-instance_method" title="#saturate (instance method)">- (Color) <strong>saturate</strong>(color, amount) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Makes a color more saturated.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#saturation-instance_method" title="#saturation (instance method)">- (Number) <strong>saturation</strong>(color) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the saturation component of a color.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#scale_color-instance_method" title="#scale_color (instance method)">- (Color) <strong>scale_color</strong>(color, kwargs) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Scales one or more properties of a color by a percentage value.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#transparentize-instance_method" title="#transparentize (instance method)">- (Color) <strong>transparentize</strong>(color, amount) </a>
    

    
      (also: #fade_out)
    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Makes a color more transparent.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#type_of-instance_method" title="#type_of (instance method)">- (String) <strong>type_of</strong>(value) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Inspects the type of the argument, returning it as an unquoted string.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#unit-instance_method" title="#unit (instance method)">- (String) <strong>unit</strong>(number) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Inspects the unit of the number, returning it as a quoted string.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#unitless-instance_method" title="#unitless (instance method)">- (Bool) <strong>unitless</strong>(number) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Inspects the unit of the number, returning a boolean indicating if it is unitless.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#unquote-instance_method" title="#unquote (instance method)">- (String) <strong>unquote</strong>(string) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Removes quotes from a string if the string is quoted, or returns the same string if it&#8217;s not.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#zip-instance_method" title="#zip (instance method)">- <strong>zip</strong>(*lists) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Combines several lists into a single comma separated list space separated lists.</span>
  
</li>

    
  </ul>


  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="declare-class_method">
  
    + <strong>declare</strong>(method_name, args, options = {}) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Declare a Sass signature for a Ruby-defined function. This includes the names of the arguments, whether the function takes a variable number of arguments, and whether the function takes an arbitrary set of keyword arguments.</p>

<p>It&#8217;s not necessary to declare a signature for a function. However, without a signature it won&#8217;t support keyword arguments.</p>

<p>A single function can have multiple signatures declared as long as each one takes a different number of arguments. It&#8217;s also possible to declare multiple signatures that all take the same number of arguments, but none of them but the first will be used unless the user uses keyword arguments.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  declare :rgba, [:hex, :alpha]
  declare :rgba, [:red, :green, :blue, :alpha]
  declare :accepts_anything, [], :var_args => true, :var_kwargs => true
  declare :some_func, [:foo, :bar, :baz], :var_kwargs => true</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Symbol</tt>)</span>
      
      
        <span class='name'>method_name</span>
      
      
      
        &mdash;
        The name of the method whose signature is being declared.
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>Array&lt;Symbol&gt;</tt>)</span>
      
      
        <span class='name'>args</span>
      
      
      
        &mdash;
        The names of the arguments for the function signature.
      
    </li>
  
</ul>

  
    
    
    
    
    
    
    <h3>Options Hash (<tt>options</tt>):</h3>
    <ul class="option">
      
        <li>
          <span class="type">(<tt>Boolean</tt>)</span>
          <span class="name">:var_args</span>
          <span class="default">
            
              &mdash; default:
              <tt>false</tt>
            
          </span>
          &mdash;Whether the function accepts a variable number of (unnamed) arguments in addition to the named arguments.
        </tr>
      
        <li>
          <span class="type">(<tt>Boolean</tt>)</span>
          <span class="name">:var_kwargs</span>
          <span class="default">
            
              &mdash; default:
              <tt>false</tt>
            
          </span>
          &mdash;Whether the function accepts other keyword arguments in addition to those in <code>:args</code>. If this is true, the Ruby function will be passed a hash from strings to <tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Sass::Script::Literal</a></tt>s as the last argument. In addition, if this is true and <code>:var_args</code> is not, Sass will ensure that the last argument passed is a hash.
        </tr>
      
    </ul>
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


262
263
264
265
266
267
268</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 262</span>

def self.declare(method_name, args, options = {})
  @signatures[method_name] ||= []
  @signatures[method_name] << Signature.new(
    args.map {|s| s.to_s},
    options[:var_args],
    options[:var_kwargs])
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="signature-class_method">
  
    + (<tt>{Symbol =&gt; Object}</tt><sup>?</sup>) <strong>signature</strong>(method_name, arg_arity, kwarg_arity) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Determine the correct signature for the number of arguments passed in for a given function. If no signatures match, the first signature is returned for error messaging.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Symbol</tt>)</span>
      
      
        <span class='name'>method_name</span>
      
      
      
        &mdash;
        The name of the Ruby function to be called.
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>arg_arity</span>
      
      
      
        &mdash;
        The number of unnamed arguments the function was passed.
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>kwarg_arity</span>
      
      
      
        &mdash;
        The number of keyword arguments the function was passed.
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>{Symbol =&gt; Object}</tt>, <tt>nil</tt>)</span>
      
      
      
      
        &mdash;
        The signature options for the matching signature, or nil if no signatures are declared for this function. See <tt><a href="#declare-class_method" title="Sass::Script::Functions.declare (method)">declare</a></tt>.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 281</span>

def self.signature(method_name, arg_arity, kwarg_arity)
  return unless @signatures[method_name]
  @signatures[method_name].each do |signature|
    return signature if signature.args.size == arg_arity + kwarg_arity
    next unless signature.args.size < arg_arity + kwarg_arity

    # We have enough args.
    # Now we need to figure out which args are varargs
    # and if the signature allows them.
    t_arg_arity, t_kwarg_arity = arg_arity, kwarg_arity
    if signature.args.size > t_arg_arity
      # we transfer some kwargs arity to args arity
      # if it does not have enough args -- assuming the names will work out.
      t_kwarg_arity -= (signature.args.size - t_arg_arity)
      t_arg_arity = signature.args.size
    end

    if (  t_arg_arity == signature.args.size ||   t_arg_arity > signature.args.size && signature.var_args  ) &&
       (t_kwarg_arity == 0                   || t_kwarg_arity > 0                   && signature.var_kwargs)
      return signature
    end
  end
  @signatures[method_name].first
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="abs-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>abs</strong>(value) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Finds the absolute value of a number.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  abs(10px) => 10px
  abs(-10px) => 10px</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>value</span>
      
      
      
        &mdash;
        The number
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        The absolute value
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>value</code> isn&#8217;t a number
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1213
1214
1215</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1213</span>

def abs(value)
  numeric_transformation(value) {|n| n.abs}
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="adjust_color-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>adjust_color</strong>(color, kwargs) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Adjusts one or more properties of a color. This can change the red, green, blue, hue, saturation, value, and alpha properties. The properties are specified as keyword arguments, and are added to or subtracted from the color&#8217;s current value for that property.</p>

<p><code>$red</code>, <code>$green</code>, and <code>$blue</code> properties should be between 0 and 255. <code>$saturation</code> and <code>$lightness</code> should be between 0% and 100%. <code>$alpha</code> should be between 0 and 1.</p>

<p>All properties are optional. You can&#8217;t specify both RGB properties (<code>$red</code>, <code>$green</code>, <code>$blue</code>) and HSL properties (<code>$hue</code>, <code>$saturation</code>, <code>$value</code>) at the same time.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  adjust-color(#102030, $blue: 5) => #102035
  adjust-color(#102030, $red: -5, $blue: 5) => #0b2035
  adjust-color(hsl(25, 100%, 80%), $lightness: -30%, $alpha: -0.4) => hsla(25, 100%, 50%, 0.6)</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>red</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>green</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>blue</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>hue</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>saturation</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>lightness</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>alpha</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>color</code> is not a color, if any keyword argument is not a number, if any keyword argument is not in the legal range, if an unexpected keyword argument is given, or if both HSL and RGB properties are given.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 796</span>

def adjust_color(color, kwargs)
  assert_type color, :Color
  with = Sass::Util.map_hash({
      "red" => [-255..255, ""],
      "green" => [-255..255, ""],
      "blue" => [-255..255, ""],
      "hue" => nil,
      "saturation" => [-100..100, "%"],
      "lightness" => [-100..100, "%"],
      "alpha" => [-1..1, ""]
    }) do |name, (range, units)|

    next unless val = kwargs.delete(name)
    assert_type val, :Number, name
    Sass::Util.check_range("$#{name}: Amount", range, val, units) if range
    adjusted = color.send(name) + val.value
    adjusted = [0, Sass::Util.restrict(adjusted, range)].max if range
    [name.to_sym, adjusted]
  end

  unless kwargs.empty?
    name, val = kwargs.to_a.first
    raise ArgumentError.new("Unknown argument $#{name} (#{val})")
  end

  color.with(with)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="adjust_hue-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>adjust_hue</strong>(color, degrees) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Changes the hue of a color while retaining the lightness and saturation. Takes a color and a number of degrees (usually between -360deg and 360deg), and returns a color with the hue rotated by that value.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  adjust-hue(hsl(120, 30%, 90%), 60deg) => hsl(180, 30%, 90%)
  adjust-hue(hsl(120, 30%, 90%), 060deg) => hsl(60, 30%, 90%)
  adjust-hue(#811, 45deg) => #886a11</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>amount</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>color</code> isn&#8217;t a color, or <code>number</code> isn&#8217;t a number
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


741
742
743
744
745</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 741</span>

def adjust_hue(color, degrees)
  assert_type color, :Color
  assert_type degrees, :Number
  color.with(:hue => color.hue + degrees.value)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="alpha-instance_method">
  
    - <strong>alpha</strong>(color) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the alpha component (opacity) of a color. This is 1 unless otherwise specified.</p>

<p>This function also supports the proprietary Microsoft <code>alpha(opacity=20)</code> syntax.</p>

  </div>
</div>
<div class="tags">
  
  
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>color</code> isn&#8217;t a color
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#opacify-instance_method" title="Sass::Script::Functions#opacify (method)">#opacify</a></li>
    
      <li><a href="#transparentize-instance_method" title="Sass::Script::Functions#transparentize (method)">#transparentize</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


579
580
581
582
583
584
585
586
587
588
589
590
591
592</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 579</span>

def alpha(*args)
  if args.all? do |a|
      a.is_a?(Sass::Script::String) && a.type == :identifier &&
        a.value =~ /^[a-zA-Z]+\s*=/
    end
    # Support the proprietary MS alpha() function
    return Sass::Script::String.new("alpha(#{args.map {|a| a.to_s}.join(", ")})")
  end

  raise ArgumentError.new("wrong number of arguments (#{args.size} for 1)") if args.size != 1

  assert_type args.first, :Color
  Sass::Script::Number.new(args.first.alpha)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="append-instance_method">
  
    - <strong>append</strong>(list, val, separator:auto) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Appends a single value onto the end of a list.</p>

<p>Unless the <code>$separator</code> argument is passed, if the list has only one item, the resulting list will be space-separated.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  append(10px 20px, 30px) => 10px 20px 30px
  append((blue, red), green) => blue, red, green
  append(10px 20px, 30px 40px) => 10px 20px (30px 40px)
  append(10px, 20px, comma) => 10px, 20px
  append((blue, red), green, space) => blue red green</pre>
    
  </div>

  <div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>list</span>
      
      
      
        &mdash;
        The list to add the value to
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>val</span>
      
      
      
        &mdash;
        The value to add to the end of the list
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>)</span>
      
      
        <span class='name'>separator</span>
      
      
      
        &mdash;
        How the list separator (comma or space) should be determined. If this is <code>comma</code> or <code>space</code>, that is always the separator; if this is <code>auto</code> (the default), the separator is the same as that used by the list.
      
    </li>
  
</ul>

</div>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1344</span>

def append(list, val, separator = Sass::Script::String.new("auto"))
  assert_type separator, :String
  unless %w[auto space comma].include?(separator.value)
    raise ArgumentError.new("Separator name must be space, comma, or auto")
  end
  sep = list.separator if list.is_a?(Sass::Script::List)
  Sass::Script::List.new(
    list.to_a + [val],
    if separator.value == 'auto'
      sep || :space
    else
      separator.value.to_sym
    end)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="blue-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>blue</strong>(color) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the blue component of a color.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>color</code> isn&#8217;t a color
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


511
512
513
514</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 511</span>

def blue(color)
  assert_type color, :Color
  Sass::Script::Number.new(color.blue)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="ceil-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>ceil</strong>(value) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Rounds a number up to the nearest whole number.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  ceil(10.4px) => 11px
  ceil(10.6px) => 11px</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>value</span>
      
      
      
        &mdash;
        The number
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        The rounded number
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>value</code> isn&#8217;t a number
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1187
1188
1189</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1187</span>

def ceil(value)
  numeric_transformation(value) {|n| n.ceil}
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="change_color-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>change_color</strong>(color, kwargs) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Changes one or more properties of a color. This can change the red, green, blue, hue, saturation, value, and alpha properties. The properties are specified as keyword arguments, and replace the color&#8217;s current value for that property.</p>

<p><code>$red</code>, <code>$green</code>, and <code>$blue</code> properties should be between 0 and 255. <code>$saturation</code> and <code>$lightness</code> should be between 0% and 100%. <code>$alpha</code> should be between 0 and 1.</p>

<p>All properties are optional. You can&#8217;t specify both RGB properties (<code>$red</code>, <code>$green</code>, <code>$blue</code>) and HSL properties (<code>$hue</code>, <code>$saturation</code>, <code>$value</code>) at the same time.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  change-color(#102030, $blue: 5) => #102005
  change-color(#102030, $red: 120, $blue: 5) => #782005
  change-color(hsl(25, 100%, 80%), $lightness: 40%, $alpha: 0.8) => hsla(25, 100%, 40%, 0.8)</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>red</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>green</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>blue</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>hue</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>saturation</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>lightness</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>alpha</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>color</code> is not a color, if any keyword argument is not a number, if any keyword argument is not in the legal range, if an unexpected keyword argument is given, or if both HSL and RGB properties are given.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


929
930
931
932
933
934
935
936
937
938
939
940
941
942
943</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 929</span>

def change_color(color, kwargs)
  assert_type color, :Color
  with = Sass::Util.map_hash(%w[red green blue hue saturation lightness alpha]) do |name, max|
    next unless val = kwargs.delete(name)
    assert_type val, :Number, name
    [name.to_sym, val.value]
  end

  unless kwargs.empty?
    name, val = kwargs.to_a.first
    raise ArgumentError.new("Unknown argument $#{name} (#{val})")
  end

  color.with(with)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="comparable-instance_method">
  
    - (<tt><a href="Bool.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Bool.html" title="Sass::Script::Bool (class)">Bool</a></tt>) <strong>comparable</strong>(number_1, number_2) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns true if two numbers are similar enough to be added, subtracted, or compared.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  comparable(2px, 1px) => true
  comparable(100px, 3em) => false
  comparable(10cm, 3mm) => true</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>number_1</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>number_2</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Bool.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Bool.html" title="Sass::Script::Bool (class)">Bool</a></tt>)</span>
      
      
      
      
        &mdash;
        indicating if the numbers can be compared.
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>number_1</code> or <code>number_2</code> aren&#8217;t numbers
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1144
1145
1146
1147
1148</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1144</span>

def comparable(number_1, number_2)
  assert_type number_1, :Number
  assert_type number_2, :Number
  Sass::Script::Bool.new(number_1.comparable_to?(number_2))
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="complement-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>complement</strong>(color) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the complement of a color. This is identical to <code>adjust-hue(color, 180deg)</code>.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>color</code> isn&#8217;t a color
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#adjust_hue-instance_method" title="Sass::Script::Functions#adjust_hue (method)">#adjust-hue</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1029
1030
1031</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1029</span>

def complement(color)
  adjust_hue color, Number.new(180)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="darken-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>darken</strong>(color, amount) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Makes a color darker. Takes a color and an amount between 0% and 100%, and returns a color with the lightness decreased by that value.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  darken(hsl(25, 100%, 80%), 30%) => hsl(25, 100%, 50%)
  darken(#800, 20%) => #200</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>amount</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>color</code> isn&#8217;t a color, or <code>number</code> isn&#8217;t a number between 0% and 100%
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#lighten-instance_method" title="Sass::Script::Functions#lighten (method)">#lighten</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


683
684
685</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 683</span>

def darken(color, amount)
  _adjust(color, amount, :lightness, 0..100, :-, "%")
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="desaturate-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>desaturate</strong>(color, amount) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Makes a color less saturated. Takes a color and an amount between 0% and 100%, and returns a color with the saturation decreased by that value.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  desaturate(hsl(120, 30%, 90%), 20%) => hsl(120, 10%, 90%)
  desaturate(#855, 20%) => #726b6b</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>amount</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>color</code> isn&#8217;t a color, or <code>number</code> isn&#8217;t a number between 0% and 100%
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#saturate-instance_method" title="Sass::Script::Functions#saturate (method)">#saturate</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


724
725
726</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 724</span>

def desaturate(color, amount)
  _adjust(color, amount, :saturation, 0..100, :-, "%")
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="floor-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>floor</strong>(value) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Rounds down to the nearest whole number.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  floor(10.4px) => 10px
  floor(10.6px) => 10px</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>value</span>
      
      
      
        &mdash;
        The number
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        The rounded number
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>value</code> isn&#8217;t a number
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1200
1201
1202</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1200</span>

def floor(value)
  numeric_transformation(value) {|n| n.floor}
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="grayscale-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>grayscale</strong>(color) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Converts a color to grayscale. This is identical to <code>desaturate(color, 100%)</code>.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>color</code> isn&#8217;t a color
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#desaturate-instance_method" title="Sass::Script::Functions#desaturate (method)">#desaturate</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1016
1017
1018
1019</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1016</span>

def grayscale(color)
  return Sass::Script::String.new("grayscale(#{color})") if color.is_a?(Sass::Script::Number)
  desaturate color, Number.new(100)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="green-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>green</strong>(color) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the green component of a color.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>color</code> isn&#8217;t a color
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


500
501
502
503</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 500</span>

def green(color)
  assert_type color, :Color
  Sass::Script::Number.new(color.green)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="hsl-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>hsl</strong>(hue, saturation, lightness) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Creates a <tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt> object from hue, saturation, and lightness. Uses the algorithm from the <a href="javascript:if(confirm(%27http://www.w3.org/TR/css3-color/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://www.w3.org/TR/css3-color/#hsl-color%27" tppabs="http://www.w3.org/TR/css3-color/#hsl-color">CSS3 spec</a>.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>hue</span>
      
      
      
        &mdash;
        The hue of the color. Should be between 0 and 360 degrees, inclusive
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>saturation</span>
      
      
      
        &mdash;
        The saturation of the color. Must be between <code>0%</code> and <code>100%</code>, inclusive
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>lightness</span>
      
      
      
        &mdash;
        The lightness of the color. Must be between <code>0%</code> and <code>100%</code>, inclusive
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
        &mdash;
        The resulting color
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>saturation</code> or <code>lightness</code> are out of bounds
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#hsla-instance_method" title="Sass::Script::Functions#hsla (method)">#hsla</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


448
449
450</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 448</span>

def hsl(hue, saturation, lightness)
  hsla(hue, saturation, lightness, Number.new(1))
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="hsla-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>hsla</strong>(hue, saturation, lightness, alpha) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Creates a <tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt> object from hue, saturation, and lightness, as well as an alpha channel indicating opacity. Uses the algorithm from the <a href="javascript:if(confirm(%27http://www.w3.org/TR/css3-color/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://www.w3.org/TR/css3-color/#hsl-color%27" tppabs="http://www.w3.org/TR/css3-color/#hsl-color">CSS3 spec</a>.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>hue</span>
      
      
      
        &mdash;
        The hue of the color. Should be between 0 and 360 degrees, inclusive
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>saturation</span>
      
      
      
        &mdash;
        The saturation of the color. Must be between <code>0%</code> and <code>100%</code>, inclusive
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>lightness</span>
      
      
      
        &mdash;
        The lightness of the color. Must be between <code>0%</code> and <code>100%</code>, inclusive
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>alpha</span>
      
      
      
        &mdash;
        The opacity of the color. Must be between 0 and 1, inclusive
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
        &mdash;
        The resulting color
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>saturation</code>, <code>lightness</code>, or <code>alpha</code> are out of bounds
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#hsl-instance_method" title="Sass::Script::Functions#hsl (method)">#hsl</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


468
469
470
471
472
473
474
475
476
477
478
479
480
481</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 468</span>

def hsla(hue, saturation, lightness, alpha)
  assert_type hue, :Number
  assert_type saturation, :Number
  assert_type lightness, :Number
  assert_type alpha, :Number

  Sass::Util.check_range('Alpha channel', 0..1, alpha)

  h = hue.value
  s = Sass::Util.check_range('Saturation', 0..100, saturation, '%')
  l = Sass::Util.check_range('Lightness', 0..100, lightness, '%')

  Color.new(:hue => h, :saturation => s, :lightness => l, :alpha => alpha.value)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="hue-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>hue</strong>(color) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the hue component of a color.</p>

<p>See <a href="javascript:if(confirm(%27http://en.wikipedia.org/wiki/HSL_and_HSV  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV%27" tppabs="http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV">the CSS3 HSL specification</a>.</p>

<p>Calculated from RGB where necessary via <a href="javascript:if(confirm(%27http://en.wikipedia.org/wiki/HSL_and_HSV  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV%27" tppabs="http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV">this algorithm</a>.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        between 0deg and 360deg
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>color</code> isn&#8217;t a color
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#adjust_hue-instance_method" title="Sass::Script::Functions#adjust_hue (method)">#adjust_hue</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


527
528
529
530</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 527</span>

def hue(color)
  assert_type color, :Color
  Sass::Script::Number.new(color.hue, ["deg"])
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="ie_hex_str-instance_method">
  
    - (<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>) <strong>ie_hex_str</strong>(color) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns an IE hex string for a color with an alpha channel suitable for passing to IE filters.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  ie-hex-str(#abc) => #FFAABBCC
  ie-hex-str(#3322BB) => #FF3322BB
  ie-hex-str(rgba(0, 255, 0, 0.5)) => #8000FF00</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>color</code> isn&#8217;t a color
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


758
759
760
761
762</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 758</span>

def ie_hex_str(color)
  assert_type color, :Color
  alpha = (color.alpha * 255).round.to_s(16).rjust(2, '0')
  Sass::Script::String.new("##{alpha}#{color.send(:hex_str)[1..-1]}".upcase)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="if-instance_method">
  
    - <strong>if</strong>(condition, if_true, if_false) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns one of two values based on the truth value of the first argument.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  if(true, 1px, 2px) => 1px
  if(false, 1px, 2px) => 2px</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Bool.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Bool.html" title="Sass::Script::Bool (class)">Bool</a></tt>)</span>
      
      
        <span class='name'>condition</span>
      
      
      
        &mdash;
        Whether the first or second value will be returned.
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>if_true</span>
      
      
      
        &mdash;
        The value that will be returned if <code>$condition</code> is true.
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>if_false</span>
      
      
      
        &mdash;
        The value that will be returned if <code>$condition</code> is false.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1411
1412
1413
1414
1415
1416
1417</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1411</span>

def if(condition, if_true, if_false)
  if condition.to_bool
    if_true
  else
    if_false
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="index-instance_method">
  
    - <strong>index</strong>(list, value) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the position of the given value within the given list. If not found, returns false.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  index(1px solid red, solid) => 2
  index(1px solid red, dashed) => false</pre>
    
  </div>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1393
1394
1395
1396
1397
1398
1399
1400</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1393</span>

def index(list, value)
  index = list.to_a.index {|e| e.eq(value).to_bool }
  if index
    Number.new(index + 1)
  else
    Bool.new(false)
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="invert-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>invert</strong>(color) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the inverse (negative) of a color. The red, green, and blue values are inverted, while the opacity is left alone.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>color</code> isn&#8217;t a color
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1040
1041
1042
1043
1044
1045
1046
1047
1048</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1040</span>

def invert(color)
  return Sass::Script::String.new("invert(#{color})") if color.is_a?(Sass::Script::Number)

  assert_type color, :Color
  color.with(
    :red => (255 - color.red),
    :green => (255 - color.green),
    :blue => (255 - color.blue))
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="join-instance_method">
  
    - <strong>join</strong>(list1, list2, separator:auto) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Joins together two lists into a new list.</p>

<p>Unless the <code>$separator</code> argument is passed, if one list is comma-separated and one is space-separated, the first parameter&#8217;s separator is used for the resulting list. If the lists have only one item each, spaces are used for the resulting list.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  join(10px 20px, 30px 40px) => 10px 20px 30px 40px
  join((blue, red), (#abc, #def)) => blue, red, #abc, #def
  join(10px, 20px) => 10px 20px
  join(10px, 20px, comma) => 10px, 20px
  join((blue, red), (#abc, #def), space) => blue red #abc #def</pre>
    
  </div>

  <div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>list1</span>
      
      
      
        &mdash;
        The first list to join
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>list2</span>
      
      
      
        &mdash;
        The second list to join
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>)</span>
      
      
        <span class='name'>separator</span>
      
      
      
        &mdash;
        How the list separator (comma or space) should be determined. If this is <code>comma</code> or <code>space</code>, that is always the separator; if this is <code>auto</code> (the default), the separator is determined as explained above.
      
    </li>
  
</ul>

</div>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1308</span>

def join(list1, list2, separator = Sass::Script::String.new("auto"))
  assert_type separator, :String
  unless %w[auto space comma].include?(separator.value)
    raise ArgumentError.new("Separator name must be space, comma, or auto")
  end
  sep1 = list1.separator if list1.is_a?(Sass::Script::List) && !list1.value.empty?
  sep2 = list2.separator if list2.is_a?(Sass::Script::List) && !list2.value.empty?
  Sass::Script::List.new(
    list1.to_a + list2.to_a,
    if separator.value == 'auto'
      sep1 || sep2 || :space
    else
      separator.value.to_sym
    end)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="length-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>length</strong>(list) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Return the length of a list.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  length(10px) => 1
  length(10px 20px 30px) => 3</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>list</span>
      
      
      
        &mdash;
        The list
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        The length
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1256
1257
1258</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1256</span>

def length(list)
  Sass::Script::Number.new(list.to_a.size)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="lighten-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>lighten</strong>(color, amount) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Makes a color lighter. Takes a color and an amount between 0% and 100%, and returns a color with the lightness increased by that value.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  lighten(hsl(0, 0%, 0%), 30%) => hsl(0, 0, 30)
  lighten(#800, 20%) => #e00</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>amount</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>color</code> isn&#8217;t a color, or <code>number</code> isn&#8217;t a number between 0% and 100%
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#darken-instance_method" title="Sass::Script::Functions#darken (method)">#darken</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


665
666
667</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 665</span>

def lighten(color, amount)
  _adjust(color, amount, :lightness, 0..100, :+, "%")
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="lightness-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>lightness</strong>(color) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the hue component of a color.</p>

<p>See <a href="javascript:if(confirm(%27http://en.wikipedia.org/wiki/HSL_and_HSV  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV%27" tppabs="http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV">the CSS3 HSL specification</a>.</p>

<p>Calculated from RGB where necessary via <a href="javascript:if(confirm(%27http://en.wikipedia.org/wiki/HSL_and_HSV  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV%27" tppabs="http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV">this algorithm</a>.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        between 0% and 100%
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>color</code> isn&#8217;t a color
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#lighten-instance_method" title="Sass::Script::Functions#lighten (method)">#lighten</a></li>
    
      <li><a href="#darken-instance_method" title="Sass::Script::Functions#darken (method)">#darken</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


561
562
563
564</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 561</span>

def lightness(color)
  assert_type color, :Color
  Sass::Script::Number.new(color.lightness, ["%"])
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="max-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>max</strong>(*values) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Finds the maximum of several values. This function takes any number of arguments.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  max(1px, 4px) => 4px
  max(5em, 3em, 4em) => 5em</pre>
    
  </div>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        The maximum value
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if any argument isn&#8217;t a number, or if not all of the arguments have comparable units
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1243
1244
1245
1246</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1243</span>

def max(*values)
  values.each {|v| assert_type v, :Number}
  values.inject {|max, val| max.gt(val).to_bool ? max : val}
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="min-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>min</strong>(*values) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Finds the minimum of several values. This function takes any number of arguments.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  min(1px, 4px) => 1px
  min(5em, 3em, 4em) => 3em</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>[<a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a>]</tt>)</span>
      
      
        <span class='name'>values</span>
      
      
      
        &mdash;
        The numbers
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        The minimum value
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if any argument isn&#8217;t a number, or if not all of the arguments have comparable units
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1228
1229
1230
1231</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1228</span>

def min(*values)
  values.each {|v| assert_type v, :Number}
  values.inject {|min, val| min.lt(val).to_bool ? min : val}
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="mix-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>mix</strong>(color1, color2, weight:50%) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Mixes together two colors. Specifically, takes the average of each of the RGB components, optionally weighted by the given percentage. The opacity of the colors is also considered when weighting the components.</p>

<p>The weight specifies the amount of the first color that should be included in the returned color. The default, 50%, means that half the first color and half the second color should be used. 25% means that a quarter of the first color and three quarters of the second color should be used.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  mix(#f00, #00f) => #7f007f
  mix(#f00, #00f, 25%) => #3f00bf
  mix(rgba(255, 0, 0, 0.5), #00f) => rgba(63, 0, 191, 0.75)</pre>
    
  </div>

  <div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color1</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color2</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>weight</span>
      
      
      
        &mdash;
        between 0% and 100%
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>color1</code> or <code>color2</code> aren&#8217;t colors, or <code>weight</code> isn&#8217;t a number between 0% and 100%
      
    </li>
  
</ul>

</div>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 969</span>

def mix(color1, color2, weight = Number.new(50))
  assert_type color1, :Color
  assert_type color2, :Color
  assert_type weight, :Number

  Sass::Util.check_range("Weight", 0..100, weight, '%')

  # This algorithm factors in both the user-provided weight (w) and the
  # difference between the alpha values of the two colors (a) to decide how
  # to perform the weighted average of the two RGB values.
  #
  # It works by first normalizing both parameters to be within [-1, 1],
  # where 1 indicates "only use color1", -1 indicates "only use color2", and
  # all values in between indicated a proportionately weighted average.
  #
  # Once we have the normalized variables w and a, we apply the formula
  # (w + a)/(1 + w*a) to get the combined weight (in [-1, 1]) of color1.
  # This formula has two especially nice properties:
  #
  #   * When either w or a are -1 or 1, the combined weight is also that number
  #     (cases where w * a == -1 are undefined, and handled as a special case).
  #
  #   * When a is 0, the combined weight is w, and vice versa.
  #
  # Finally, the weight of color1 is renormalized to be within [0, 1]
  # and the weight of color2 is given by 1 minus the weight of color1.
  p = (weight.value/100.0).to_f
  w = p*2 - 1
  a = color1.alpha - color2.alpha

  w1 = (((w * a == -1) ? w : (w + a)/(1 + w*a)) + 1)/2.0
  w2 = 1 - w1

  rgb = color1.rgb.zip(color2.rgb).map {|v1, v2| v1*w1 + v2*w2}
  alpha = color1.alpha*p + color2.alpha*(1-p)
  Color.new(rgb + [alpha])
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="nth-instance_method">
  
    - (<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>) <strong>nth</strong>(list, n) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Gets the nth item in a list.</p>

<p>Note that unlike some languages, the first item in a Sass list is number 1, the second number 2, and so forth.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  nth(10px 20px 30px, 1) => 10px
  nth((Helvetica, Arial, sans-serif), 3) => sans-serif</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>list</span>
      
      
      
        &mdash;
        The list
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>n</span>
      
      
      
        &mdash;
        The index into the list
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
      
      
        &mdash;
        The nth item in the list
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>n</code> isn&#8217;t an integer between 1 and the list&#8217;s length.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1273</span>

def nth(list, n)
  assert_type n, :Number
  if !n.int?
    raise ArgumentError.new("List index #{n} must be an integer")
  elsif n.to_i < 1
    raise ArgumentError.new("List index #{n} must be greater than or equal to 1")
  elsif list.to_a.size == 0
    raise ArgumentError.new("List index is #{n} but list has no items")
  elsif n.to_i > (size = list.to_a.size)
    raise ArgumentError.new("List index is #{n} but list is only #{size} item#{'s' if size != 1} long")
  end

  list.to_a[n.to_i - 1]
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="opacify-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>opacify</strong>(color, amount) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='fade_in-instance_method'>fade_in</span></span>
    </span>
  
</p><div class="docstring">
  <div class="discussion">
    <p>Makes a color more opaque. Takes a color and an amount between 0 and 1, and returns a color with the opacity increased by that value.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  opacify(rgba(0, 0, 0, 0.5), 0.1) => rgba(0, 0, 0, 0.6)
  opacify(rgba(0, 0, 17, 0.8), 0.2) => #001</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>amount</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>color</code> isn&#8217;t a color, or <code>number</code> isn&#8217;t a number between 0 and 1
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#transparentize-instance_method" title="Sass::Script::Functions#transparentize (method)">#transparentize</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


623
624
625</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 623</span>

def opacify(color, amount)
  _adjust(color, amount, :alpha, 0..1, :+)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="opacity-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>opacity</strong>(color) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the alpha component (opacity) of a color. This is 1 unless otherwise specified.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>color</code> isn&#8217;t a color
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#opacify-instance_method" title="Sass::Script::Functions#opacify (method)">#opacify</a></li>
    
      <li><a href="#transparentize-instance_method" title="Sass::Script::Functions#transparentize (method)">#transparentize</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


603
604
605
606
607</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 603</span>

def opacity(color)
  return Sass::Script::String.new("opacity(#{color})") if color.is_a?(Sass::Script::Number)
  assert_type color, :Color
  Sass::Script::Number.new(color.alpha)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="percentage-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>percentage</strong>(value) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Converts a decimal number to a percentage.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  percentage(100px / 50px) => 200%</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>value</span>
      
      
      
        &mdash;
        The decimal number to convert to a percentage
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        The percentage
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>value</code> isn&#8217;t a unitless number
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1158
1159
1160
1161
1162
1163</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1158</span>

def percentage(value)
  unless value.is_a?(Sass::Script::Number) && value.unitless?
    raise ArgumentError.new("#{value.inspect} is not a unitless number")
  end
  Sass::Script::Number.new(value.value * 100, ['%'])
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="quote-instance_method">
  
    - (<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>) <strong>quote</strong>(string) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Add quotes to a string if the string isn&#8217;t quoted, or returns the same string if it is.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  quote("foo") => "foo"
  quote(foo) => "foo"</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>)</span>
      
      
        <span class='name'>string</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>string</code> isn&#8217;t a string
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#unquote-instance_method" title="Sass::Script::Functions#unquote (method)">#unquote</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1080
1081
1082
1083</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1080</span>

def quote(string)
  assert_type string, :String
  Sass::Script::String.new(string.value, :string)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="red-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>red</strong>(color) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the red component of a color.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>color</code> isn&#8217;t a color
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


489
490
491
492</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 489</span>

def red(color)
  assert_type color, :Color
  Sass::Script::Number.new(color.red)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="rgb-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>rgb</strong>(red, green, blue) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Creates a <tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt> object from red, green, and blue values.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>red</span>
      
      
      
        &mdash;
        A number between 0 and 255 inclusive, or between 0% and 100% inclusive
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>green</span>
      
      
      
        &mdash;
        A number between 0 and 255 inclusive, or between 0% and 100% inclusive
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>blue</span>
      
      
      
        &mdash;
        A number between 0 and 255 inclusive, or between 0% and 100% inclusive
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#rgba-instance_method" title="Sass::Script::Functions#rgba (method)">#rgba</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


373
374
375
376
377
378
379
380
381
382
383
384
385
386
387</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 373</span>

def rgb(red, green, blue)
  assert_type red, :Number
  assert_type green, :Number
  assert_type blue, :Number

  Color.new([red, green, blue].map do |c|
      v = c.value
      if c.numerator_units == ["%"] && c.denominator_units.empty?
        v = Sass::Util.check_range("Color value", 0..100, c, '%')
        v * 255 / 100.0
      else
        Sass::Util.check_range("Color value", 0..255, c)
      end
    end)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="rgba-instance_method">
  
    
      <span class="overload">- (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>rgba</strong>(red, green, blue, alpha) </span>
    
      <span class="overload">- (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>rgba</strong>(color, alpha) </span>
    
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <h3>Overloads:</h3>
  <ul class="overload">
    
      
      <li class="overload_item">
        <span class="signature">- (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>rgba</strong>(red, green, blue, alpha) </span>
        <div class="docstring">
  <div class="discussion">
    <p>Creates a <tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt> object from red, green, and blue values, as well as an alpha channel indicating opacity.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>red</span>
      
      
      
        &mdash;
        A number between 0 and 255 inclusive
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>green</span>
      
      
      
        &mdash;
        A number between 0 and 255 inclusive
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>blue</span>
      
      
      
        &mdash;
        A number between 0 and 255 inclusive
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>alpha</span>
      
      
      
        &mdash;
        A number between 0 and 1
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div>
      </li>
    
      
      <li class="overload_item">
        <span class="signature">- (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>rgba</strong>(color, alpha) </span>
        <div class="docstring">
  <div class="discussion">
    <p>Sets the opacity of a color.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  rgba(#102030, 0.5) => rgba(16, 32, 48, 0.5)
  rgba(blue, 0.2)    => rgba(0, 0, 255, 0.2)</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>alpha</span>
      
      
      
        &mdash;
        A number between 0 and 1
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div>
      </li>
    
  </ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#rgb-instance_method" title="Sass::Script::Functions#rgb (method)">#rgb</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 416</span>

def rgba(*args)
  case args.size
  when 2
    color, alpha = args

    assert_type color, :Color
    assert_type alpha, :Number

    Sass::Util.check_range('Alpha channel', 0..1, alpha)
    color.with(:alpha => alpha.value)
  when 4
    red, green, blue, alpha = args
    rgba(rgb(red, green, blue), alpha)
  else
    raise ArgumentError.new("wrong number of arguments (#{args.size} for 4)")
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="round-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>round</strong>(value) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Rounds a number to the nearest whole number.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  round(10.4px) => 10px
  round(10.6px) => 11px</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>value</span>
      
      
      
        &mdash;
        The number
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        The rounded number
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>value</code> isn&#8217;t a number
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1174
1175
1176</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1174</span>

def round(value)
  numeric_transformation(value) {|n| n.round}
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="saturate-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>saturate</strong>(color, amount) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Makes a color more saturated. Takes a color and an amount between 0% and 100%, and returns a color with the saturation increased by that value.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  saturate(hsl(120, 30%, 90%), 20%) => hsl(120, 50%, 90%)
  saturate(#855, 20%) => #9e3f3f</pre>
    
  </div>

  <div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>amount</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>color</code> isn&#8217;t a color, or <code>number</code> isn&#8217;t a number between 0% and 100%
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#desaturate-instance_method" title="Sass::Script::Functions#desaturate (method)">#desaturate</a></li>
    
  </ul>

</div>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


702
703
704
705
706
707</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 702</span>

def saturate(color, amount = nil)
  # Support the filter effects definition of saturate.
  # https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html
  return Sass::Script::String.new("saturate(#{color})") if amount.nil?
  _adjust(color, amount, :saturation, 0..100, :+, "%")
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="saturation-instance_method">
  
    - (<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>) <strong>saturation</strong>(color) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the saturation component of a color.</p>

<p>See <a href="javascript:if(confirm(%27http://en.wikipedia.org/wiki/HSL_and_HSV  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV%27" tppabs="http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV">the CSS3 HSL specification</a>.</p>

<p>Calculated from RGB where necessary via <a href="javascript:if(confirm(%27http://en.wikipedia.org/wiki/HSL_and_HSV  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV%27" tppabs="http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV">this algorithm</a>.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
      
      
        &mdash;
        between 0% and 100%
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>color</code> isn&#8217;t a color
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#saturate-instance_method" title="Sass::Script::Functions#saturate (method)">#saturate</a></li>
    
      <li><a href="#desaturate-instance_method" title="Sass::Script::Functions#desaturate (method)">#desaturate</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


544
545
546
547</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 544</span>

def saturation(color)
  assert_type color, :Color
  Sass::Script::Number.new(color.saturation, ["%"])
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="scale_color-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>scale_color</strong>(color, kwargs) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Scales one or more properties of a color by a percentage value. Unlike <tt><a href="#adjust_color-instance_method" title="Sass::Script::Functions#adjust_color (method)">adjust-color</a></tt>, which changes a color&#8217;s properties by fixed amounts, <tt><a href="#scale_color-instance_method" title="Sass::Script::Functions#scale_color (method)">scale-color</a></tt> fluidly changes them based on how high or low they already are. That means that lightening an already-light color with <tt><a href="#scale_color-instance_method" title="Sass::Script::Functions#scale_color (method)">scale-color</a></tt> won&#8217;t change the lightness much, but lightening a dark color by the same amount will change it more dramatically. This has the benefit of making <code>scale-color($color, ...)</code> have a similar effect regardless of what <code>$color</code> is.</p>

<p>For example, the lightness of a color can be anywhere between 0 and 100. If <code>scale-color($color, $lightness: 40%)</code> is called, the resulting color&#8217;s lightness will be 40% of the way between its original lightness and 100. If <code>scale-color($color, $lightness: -40%)</code> is called instead, the lightness will be 40% of the way between the original and 0.</p>

<p>This can change the red, green, blue, saturation, value, and alpha properties. The properties are specified as keyword arguments. All arguments should be percentages between 0% and 100%.</p>

<p>All properties are optional. You can&#8217;t specify both RGB properties (<code>$red</code>, <code>$green</code>, <code>$blue</code>) and HSL properties (<code>$saturation</code>, <code>$value</code>) at the same time.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  scale-color(hsl(120, 70, 80), $lightness: 50%) => hsl(120, 70, 90)
  scale-color(rgb(200, 150, 170), $green: -40%, $blue: 70%) => rgb(200, 90, 229)
  scale-color(hsl(200, 70, 80), $saturation: -90%, $alpha: -30%) => hsla(200, 7, 80, 0.7)</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>red</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>green</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>blue</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>saturation</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>lightness</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>alpha</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>color</code> is not a color, if any keyword argument is not a percentage between 0% and 100%, if an unexpected keyword argument is given, or if both HSL and RGB properties are given.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 864</span>

def scale_color(color, kwargs)
  assert_type color, :Color
  with = Sass::Util.map_hash({
      "red" => 255,
      "green" => 255,
      "blue" => 255,
      "saturation" => 100,
      "lightness" => 100,
      "alpha" => 1
    }) do |name, max|

    next unless val = kwargs.delete(name)
    assert_type val, :Number, name
    if !(val.numerator_units == ['%'] && val.denominator_units.empty?)
      raise ArgumentError.new("$#{name}: Amount #{val} must be a % (e.g. #{val.value}%)")
    else
      Sass::Util.check_range("$#{name}: Amount", -100..100, val, '%')
    end

    current = color.send(name)
    scale = val.value/100.0
    diff = scale > 0 ? max - current : current
    [name.to_sym, current + diff*scale]
  end

  unless kwargs.empty?
    name, val = kwargs.to_a.first
    raise ArgumentError.new("Unknown argument $#{name} (#{val})")
  end

  color.with(with)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="transparentize-instance_method">
  
    - (<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>) <strong>transparentize</strong>(color, amount) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='fade_out-instance_method'>fade_out</span></span>
    </span>
  
</p><div class="docstring">
  <div class="discussion">
    <p>Makes a color more transparent. Takes a color and an amount between 0 and 1, and returns a color with the opacity decreased by that value.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  transparentize(rgba(0, 0, 0, 0.5), 0.1) => rgba(0, 0, 0, 0.4)
  transparentize(rgba(0, 0, 0, 0.8), 0.2) => rgba(0, 0, 0, 0.6)</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
        <span class='name'>color</span>
      
      
      
    </li>
  
    <li>
      
        <span class='type'>(<tt><a href="Number.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Number.html" title="Sass::Script::Number (class)">Number</a></tt>)</span>
      
      
        <span class='name'>amount</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Color.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Color.html" title="Sass::Script::Color (class)">Color</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        If <code>color</code> isn&#8217;t a color, or <code>number</code> isn&#8217;t a number between 0 and 1
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#opacify-instance_method" title="Sass::Script::Functions#opacify (method)">#opacify</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


644
645
646</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 644</span>

def transparentize(color, amount)
  _adjust(color, amount, :alpha, 0..1, :-)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="type_of-instance_method">
  
    - (<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>) <strong>type_of</strong>(value) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Inspects the type of the argument, returning it as an unquoted string.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  type-of(100px)  => number
  type-of(asdf)   => string
  type-of("asdf") => string
  type-of(true)   => bool
  type-of(#fff)   => color
  type-of(blue)   => color</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>value</span>
      
      
      
        &mdash;
        The object to inspect
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>)</span>
      
      
      
      
        &mdash;
        The unquoted string name of the literal&#8217;s type
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1097
1098
1099</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1097</span>

def type_of(value)
  Sass::Script::String.new(value.class.name.gsub(/Sass::Script::/,'').downcase)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="unit-instance_method">
  
    - (<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>) <strong>unit</strong>(number) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Inspects the unit of the number, returning it as a quoted string. Complex units are sorted in alphabetical order by numerator and denominator.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  unit(100) => ""
  unit(100px) => "px"
  unit(3em) => "em"
  unit(10px * 5em) => "em*px"
  unit(10px * 5em / 30cm / 1rem) => "em*px/cm*rem"</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>number</span>
      
      
      
        &mdash;
        The number to inspect
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>)</span>
      
      
      
      
        &mdash;
        The unit(s) of the number
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>number</code> isn&#8217;t a number
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1114
1115
1116
1117</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1114</span>

def unit(number)
  assert_type number, :Number
  Sass::Script::String.new(number.unit_str, :string)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="unitless-instance_method">
  
    - (<tt><a href="Bool.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Bool.html" title="Sass::Script::Bool (class)">Bool</a></tt>) <strong>unitless</strong>(number) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Inspects the unit of the number, returning a boolean indicating if it is unitless.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  unitless(100) => true
  unitless(100px) => false</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Literal.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Literal.html" title="Sass::Script::Literal (class)">Literal</a></tt>)</span>
      
      
        <span class='name'>number</span>
      
      
      
        &mdash;
        The number to inspect
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Bool.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/Bool.html" title="Sass::Script::Bool (class)">Bool</a></tt>)</span>
      
      
      
      
        &mdash;
        Whether or not the number is unitless
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>number</code> isn&#8217;t a number
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1128
1129
1130
1131</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1128</span>

def unitless(number)
  assert_type number, :Number
  Sass::Script::Bool.new(number.unitless?)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="unquote-instance_method">
  
    - (<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>) <strong>unquote</strong>(string) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Removes quotes from a string if the string is quoted, or returns the same string if it&#8217;s not.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  unquote("foo") => foo
  unquote(foo) => foo</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>)</span>
      
      
        <span class='name'>string</span>
      
      
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="String.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Script/String.html" title="Sass::Script::String (class)">String</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
        &mdash;
        if <code>string</code> isn&#8217;t a string
      
    </li>
  
</ul>

  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="#quote-instance_method" title="Sass::Script::Functions#quote (method)">#quote</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1061
1062
1063
1064
1065
1066
1067</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1061</span>

def unquote(string)
  if string.is_a?(Sass::Script::String)
    Sass::Script::String.new(string.value, :identifier)
  else
    string
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="zip-instance_method">
  
    - <strong>zip</strong>(*lists) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Combines several lists into a single comma separated list space separated lists.</p>

<p>The length of the resulting list is the length of the shortest list.</p>

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4></h4>
      <pre class="example code">  zip(1px 1px 3px, solid dashed solid, red green blue)
  => 1px solid red, 1px dashed green, 3px solid blue</pre>
    
  </div>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/script/functions.rb', line 1370</span>

def zip(*lists)
  length = nil
  values = []
  lists.each do |list|
    array = list.to_a
    values << array.dup
    length = length.nil? ? array.length : [length, array.length].min
  end
  values.each do |value|
    value.slice!(length)
  end
  new_list_value = values.first.zip(*values[1..-1])
  List.new(new_list_value.map{|list| List.new(list, :space)}, :comma)
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:33:35 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>